SOFTWARE DEFINED RADIO (SDR)
INTRO
Signal processing like filtering, mixing and amplifiying is easier and more accurate in the digital domain than in the analog world. It is quite obvious that the stage of conversion should be done as early as possible. Since the sampled bandwith can be not more than half of the sampling frequency, the ADC is the limiting element. Conceptually there are 3 types of SDR architectures, depending on the place of the ADC within the reception path. The first generation (since 1990, named baseband digital radio) samples baseband signals and the DSP performes the final stages to recvover the signals. The next generation (since 2000, named IF- digital radio) samples the signal at the intermediate frequency (IF) stage and the downconversion to the baseband is done digitally. The latest generation (since 2015, named direct RF-sampling receiver) is able to sample the RF-spectrum with highspeed ADCs (in the range of gigasamples per second) and the downconversion and demodulation process is done digitally.
OVERVIEW
A list of Matlab-supported and popular plattforms:
Device={'NESDR Mini';'NESDR Smartee';'ADALM Pluto';'USRP-B200';'USRP-E310';'USRP-N200 & 1xRF-DB';'USRP-X300 & 1xRF-DB';'Zedboard SDR EVM'};
Manufacturer={'Noo-Elec';'Noo-Elec';'Analog Devices';'Ettus';'Ettus';'Ettus';'Ettus';'AVNet'};
Driver={'RTL';'RTL';'Pluto';'USRP';'USRP';'USP';'USRP';'Zynq'};
Tuning_Range_MHz={'24 - 1766';'0.5 - 1766';'325 or 70 - 3800 or 6000';'70 - 6000';'70 - 6000';'0 - 6000';'0 - 6000';'70 - 6000'};
BW_MHz={'1.4';'1.4';'20';'56';'56';'40';'160';'56'};
ADC_DAC_Bit={'8/-';'8/-';'12/12';'12/12';'12/12';'14/16';'14/16';'12/12'};
Output_MSps={'2.8';'2.8';'7-12';'61.44';'61.44';'100';'200';'61.44'};
Interface={'USB 2.0';'USB 2.0';'USB 2.0 or virtual E';'USB 3.0';'1 GBE';'1 GBE';'10 GBE';'1 GBE'};
Euro_Price={'22';'40';'85';'740';'2970';'1670+975';'4280+1190';'1300'};
RF_Frontend={'R820T';'R820T2';'AD9363';'AD9364';'AD9361';'UBX40';'UBX160';'AD9361-FMC'};
Host_HW={'RTL2832U';'RTL2832U';'Zynq-7010';'Zynq-7010';'Zynq-7020';'Spartan3A';'Kintex 7';'Zynq-7000'};
SDR_Overview=table(Device,Manufacturer,Driver,Tuning_Range_MHz,BW_MHz,ADC_DAC_Bit,Output_MSps,Interface,Euro_Price,RF_Frontend,Host_HW)
SDR_Overview = 8×11 table
| Device | Manufacturer | Driver | Tuning_Range_MHz | BW_MHz | ADC_DAC_Bit | Output_MSps | Interface | Euro_Price | RF_Frontend | Host_HW |
---|
1 | 'NESDR Mini' | 'Noo-Elec' | 'RTL' | '24 - 1766' | '1.4' | '8/-' | '2.8' | 'USB 2.0' | '22' | 'R820T' | 'RTL2832U' |
---|
2 | 'NESDR Smartee' | 'Noo-Elec' | 'RTL' | '0.5 - 1766' | '1.4' | '8/-' | '2.8' | 'USB 2.0' | '40' | 'R820T2' | 'RTL2832U' |
---|
3 | 'ADALM Pluto' | 'Analog Devices' | 'Pluto' | '325 or 70 - 3800 or 6000' | '20' | '12/12' | '7-12' | 'USB 2.0 or virtual E' | '85' | 'AD9363' | 'Zynq-7010' |
---|
4 | 'USRP-B200' | 'Ettus' | 'USRP' | '70 - 6000' | '56' | '12/12' | '61.44' | 'USB 3.0' | '740' | 'AD9364' | 'Zynq-7010' |
---|
5 | 'USRP-E310' | 'Ettus' | 'USRP' | '70 - 6000' | '56' | '12/12' | '61.44' | '1 GBE' | '2970' | 'AD9361' | 'Zynq-7020' |
---|
6 | 'USRP-N200 & 1xRF-DB' | 'Ettus' | 'USP' | '0 - 6000' | '40' | '14/16' | '100' | '1 GBE' | '1670+975' | 'UBX40' | 'Spartan3A' |
---|
7 | 'USRP-X300 & 1xRF-DB' | 'Ettus' | 'USRP' | '0 - 6000' | '160' | '14/16' | '200' | '10 GBE' | '4280+1190' | 'UBX160' | 'Kintex 7' |
---|
8 | 'Zedboard SDR EVM' | 'AVNet' | 'Zynq' | '70 - 6000' | '56' | '12/12' | '61.44' | '1 GBE' | '1300' | 'AD9361-FMC' | 'Zynq-7000' |
---|
IQ-DATA
Since SDR-signals are often represented in a specific format, here is a short explanation about IQ-data:
A signal is represented by its amplitude, frequency and phase.
A numeric value at a specific time represents just x, while IQ-data represent the momentary amplitude and the angle of the signal, with 
, with oscillator 
, with oscillator 
disp(get_link('-> more about IQ-DATA','MOD_IQ'));
FM-MONO-RECEIVER
At first an SDR-FM-Mono-Receiver is shown with the help of a Simulink-model. The signal source is one of several SDR-devices or IQ-data from the workspace. The demodulation is done by a delayline-demodulator followed by a lowpass- and a deemphasis-filter. Before the signal is fed to a speaker its samplerate is downsampled to an appropriate sampling frequency for an audiosignal.
file2sim='FM_RX_SDR_MONO';
convert_model(file2sim); % create HTML-version of simulinkfile
disp(get_link('-> create SDR FM-Mono-RX in Simulink',file2sim));
[wav_RX,I_RX,Q_RX,~,~]=sim_model(file2sim);
titles={'wav-info';'I-data (@fs)';'Q-data (@fs)'};
ylabels={'Amplitude';'Amplitude';'Amplitude'};
plot_MOD(t,wav_RX(:),I_RX(:),Q_RX(:),'titles',titles,'ylabels',ylabels)
end
## Establishing connection to hardware. This process can take several seconds.
pic_file=strcat(file2sim,pic_ext,'.jpg');
if exist(pic_file,'file')
disp('SDR-FM-Mono-Receiver in Simulink - block diagram ');
end
SDR-FM-Mono-Receiver in Simulink - block diagram
DEMODULATION
If you are not familiar with an MPX signal hava a look at the Wikipedia-site of FM broadcasting. It can be seen that the monophonic information is in the frequency-band between 30 Hz and 15 kHz and the complete MPX signal is FM modulated with a carrier frequency between 87.5 and 108 MHz in most of the countries of the world. The center frequency of the SDR-device is adjusted to the station´s frequency of interest. The FM spectrum is mixed down to baseband and the IQ-samples of the MPX-signal with a samplerate of fs_SDR are are the output of the receiver block.
The delayline demodulator splits the signal in two paths and delays one of them for one sample. Since the IQ-data are represented as complex numbers the angle difference between two consecutice samples can be derived by multiplication of a sample and its previous conjugated sample
with
. It the carrier is unmodulated the angle of two consecutive samples have the same value and
. An increase of the modulated frequency is indicated by
a decrement results in
. The maximum frequency deviation of an FM signal is 75 kHz, which should result to a maximum value of 1. Therefore the maximum phase difference of two examined samples during a time periode of 
. If a radio station modulates its program with a maximum frequency shift of 75 kHz the output of the demodulator must be normalized by a multiplication of k=
. After the demodulation of the signal it has to be filtered to supress frequencies above 15 kHz. A very simple digital lowpassfilter design can be found here:
disp(get_link('-> more about the design of a simple LPF ','MOD_LPF'));
Today it is common practice, that the transmitted signal gets a so called preemphasis which boosts the trebles. The received signal has to be processed with the complementary deemphasis which results in a better SNR of the received signal.
disp(get_link('-> more about pre- and de-emphasis','PRE_DE_EMPHASIS'));
In general the output-data of the SDR-device have a higher sample rate than the operating sampling frequency of the audio device. Therefore the signal´s samplerate needs a downconversion. This can be done easily, if the SDR-device´s sampling frequency is an integer multiple
of the soundcard´s sampling frequency. In this case only each
sample is taken and the sampling frequency can be reduced to the desired value. The lowpass filter and the de-emphasis filter before decimation are shaping the bandwidth properly, so that the sampling theorem is not violated.
FM-STEREO-RECEIVER
The Simulink-FM-Stereo-Receiver allows to switch between three different devices, a USRP B200, an ADALM Pluto and an RTL device. Furthermore it is possible to receive IQ-samples from the workspace. At the SDR-receiver the antenna-signal is amplified by a low noise amplifier and then directly ADC-converted by high speed ADCs. A digital IQ-mixer downconverts the signal to baseband and a decimation filter section downconverts the samplerate from Mbps to an appropriate samplerate of
. A Xilinx FPGA provides the driver functionality to export the datastream to the DSP-hostsystem in this case Matlab or Simulink.
file2sim='FM_RX_SDR_STEREO';
convert_model(file2sim); % create HTML-version of simulinkfile
disp(get_link('-> create SDR FM-Stereo-RX in Simulink',file2sim));
[wav_RX,~,~,~,~]=sim_model(file2sim);
titles={'wav-Left','wav-Right'};
ylabels={'Amplitude','Amplitude'};
Left=wav_RX(:,1,:); Right=wav_RX(:,2,:);
plot_MOD(t,Left(:),Right(:),'titles',titles,'ylabels',ylabels)
end
## Establishing connection to hardware. This process can take several seconds.
pic_file=strcat(file2sim,pic_ext,'.jpg');
if exist(pic_file,'file')
disp('SDR-FM-Stereo-Receiver in Simulink - block diagram ');
end
SDR-FM-Stereo-Receiver in Simulink - block diagram
DEMODULATION
The first block of the Stereo FM-Receiver in Simulink is identical to the Mono Receiver´s delayline demodulator. The signal is split into 3 paths for decoding the main- (or L+R), the difference- (or L-R) and the pilot tone´s frequency band. In each path a filter limits the signal to the appropriate frequency bands. The first path is identical to the mono receiver and delivers the sum of the left and the right channel. The second path carries an AM difference-signal, with a carrier of 38 kHz. The demodulation is done by the help of a synchronized oscillator. The third path captures the pilot tone with a frequency of 19 kHz which is doubled then by a 2f-generator.
The idea of doubling the frequency can be expressed by the equation
. The corresponding Simulink-block contains a gain element, because the portion of the pilot tone in the MPX-signal is only 10%. It is followed by a
and a gain element. This approach uses a differentiator to obtain a phase shift of
:
. Given that
then
and the differentiator has to be divided by
to get the phase shifted
-pilot-tone
. The
-multiplication and the
-division are done in one step by a gain of
. The original and the shifted signals are mixed and then amplified by 2 which leads to the formula of
. Since
we obtain the desired signal. The sideband and the carrier are mixed. This results in one frequency band located at 76 kHz and a desired one located at the baseband which is passed by a filter. The amplitude loss due to mixing is made up by an adjacent gain block. After a de-demphasis and a downconversion of the samplerate the left and right signal can be obtained by the formulas:
,
. Precisely it must be said, that
and
, but the gain of 2 compensates the attenuation caused by the MPX-signal (
FM-STEREO-TRANSMITTER
The Simulink-FM-Stereo-Transmitter allows to switch between two different devices, a USRP B200 or an ADALM Pluto. Furthermore it is possible to save generated IQ-samples to the workspace. The SDR-transmitter accepts IQ-samples which are internally upconverted to the high-speed DAC´s operating frequency and converted there to an analog baseband signal. The analog signal is mixed directly to RF with an internal oscillator running at the center frequency. After a small power amplifier the signal is radiated by the antenna.
file2sim='FM_TX_SDR_STEREO';
convert_model(file2sim); % create HTML-version of simulinkfile
disp(get_link('-> create SDR FM-Stereo-TX in Simulink',file2sim));
pic_file=strcat(file2sim,pic_ext,'.jpg');
if exist(pic_file,'file')
disp('SDR-FM-Stereo-Transmitter in Simulink - block diagram ');
end
SDR-FM-Stereo-Transmitter in Simulink - block diagram
MODULATION
The FM-transmitter is able to process 2 different kinds of sources. IQ-data contains the FM-MPX-signal and can be processed straightforward just being buffered to reduce the system load and to create the stream format of the second path. The audiofile needs to be upconverted first to meet the transmitter´s system sampling frequency
. This is done by an FIR-interpolation which upsamples the signal and removes alias frequencies. The loss of amplitude is compensated by an appropriate gain of
. The MPX-encoder creates an M-, S- and P- signal, pre-emphases the M- and the AM-S-signal, adds the weighted signals and outputs a MONO- or a STEREO-MPX signal. Since the phase of the signal hast to be calculated, an FM-element integrates the signal (
, done by a transfer function
with an appropriate gain. This can be derived by the difference equation
. The gain also adjusts the signal to achieve the appropriate frequency deviation, considering that a maximum input signal of one leads to a
. For an FM-signal
. At last a complex value is generated out of the phase and a constant magnitude of 0.9. Practical experience has shown that the maximum value of one sometimes leads to distortion of the transmitted signal.
LINKS